package com.tddx.activiti.redis.service;

import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class RedisService {
	
	@Cacheable(value="demo", key="#id")
	public Object demo1(String id){
		System.out.println("调用了查询方法。。。");
		return 2;
	}
	
	@CachePut(value="demo", key="#id")
	public Object demo2(String id){
		System.out.println("调用了demo2方法");
		return 3;
	}
}
